<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!-- Copyright 1997 The Open Group, All Rights Reserved -->
<title>shm_unlink</title>
</head><body bgcolor=white>
<center>
<font size=2>
The Single UNIX &reg; Specification, Version 2<br>
Copyright &copy; 1997 The Open Group

</font></center><hr size=2 noshade>
<h4><a name = "tag_000_008_534">&nbsp;</a>NAME</h4><blockquote>
shm_unlink - remove a shared memory object
(<b>REALTIME</b>)
</blockquote><h4><a name = "tag_000_008_535">&nbsp;</a>SYNOPSIS</h4><blockquote>
<pre><code>

#include &lt;<a href="sysmman.h.html">sys/mman.h</a>&gt;

int shm_unlink(const char * <i>name</i>);
</code>
</pre>
</blockquote><h4><a name = "tag_000_008_536">&nbsp;</a>DESCRIPTION</h4><blockquote>
The
<i>shm_unlink()</i>
function removes the name of the shared memory object named by the
string pointed to by
<i>name</i>.
If one or more references to the shared memory object exist
when the object is unlinked,
the name is removed before
<i>shm_unlink()</i>
returns, but the removal of the memory object contents is postponed
until all open and map references
to the shared memory object have been removed.
</blockquote><h4><a name = "tag_000_008_537">&nbsp;</a>RETURN VALUE</h4><blockquote>
Upon successful completion, a value of zero is returned.
Otherwise, a value of -1 is returned and
<i>errno</i>
will be set to indicate the error.
If -1 is returned,
the named shared memory object will not be changed by this function call.
</blockquote><h4><a name = "tag_000_008_538">&nbsp;</a>ERRORS</h4><blockquote>
The 
<i>shm_unlink()</i>
function will fail if:
<dl compact>

<dt>[EACCES]<dd>
Permission is denied to unlink the named
shared memory object.

<dt>[ENAMETOOLONG]<dd>

The length of the
<i>name</i>
string exceeds {NAME_MAX} while
_POSIX_NO_TRUNC is in effect.

<dt>[ENOENT]<dd>
The named shared memory object
does not exist.

<dt>[ENOSYS]<dd>
The function
<i>shm_unlink()</i>
is not supported by this implementation.

</dl>
</blockquote><h4><a name = "tag_000_008_539">&nbsp;</a>EXAMPLES</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_008_540">&nbsp;</a>APPLICATION USAGE</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_008_541">&nbsp;</a>FUTURE DIRECTIONS</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_008_542">&nbsp;</a>SEE ALSO</h4><blockquote>
<i><a href="close.html">close()</a></i>,
<i><a href="mmap.html">mmap()</a></i>,
<i><a href="munmap.html">munmap()</a></i>,
<i><a href="shmat.html">shmat()</a></i>,
<i><a href="shmctl.html">shmctl()</a></i>,
<i><a href="shmdt.html">shmdt()</a></i>,
<i><a href="shm_open.html">shm_open()</a></i>,
<i><a href="sysmman.h.html">&lt;sys/mman.h&gt;</a></i>.
</blockquote><h4>DERIVATION</h4><blockquote>
Derived from the POSIX Realtime Extension (1003.1b-1993/1003.1i-1995)
</blockquote><hr size=2 noshade>
<center><font size=2>
UNIX &reg; is a registered Trademark of The Open Group.<br>
Copyright &copy; 1997 The Open Group
<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]

</font></center><hr size=2 noshade>
</body></html>

